﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
///ADS 的摘要说明
/// </summary>
public class ADS
{
	public ADS()
	{
		//
		//TODO: 在此处添加构造函数逻辑
		//
	}


    /// <summary>
    /// 根据位置ID读取相应的广告代码；
    /// </summary>
    public static string GetADsCode(Int32 adsid)
    {
        string adscodestring="";
        DataSet_fp_ads_DyhTableAdapters.Dyh_ADTableAdapter ads_code = new DataSet_fp_ads_DyhTableAdapters.Dyh_ADTableAdapter();
        if (ads_code.Get_ADS_Code_Data_By_PositionId(adsid).Rows.Count>0)
        {
           adscodestring= ads_code.Get_ADS_Code_Data_By_PositionId(adsid).Rows[0]["content"].ToString().Trim(); 
        }
        return adscodestring;
    }
}
